package GUI;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.JPanel;

/**
 * This class produces the Panel for the background image
 * @author Wayang Group Bremen
 * @version 0.9
 */
public class BackgroundPanelGui extends JPanel {
	public BackgroundPanelGui(){
		
	}
	
	private static final long serialVersionUID = 1L;
	//private Image image; // not needed "never read locally"...
	public BufferedImage bi;
	BackgroundPanelGui(String path) {
		try {
			bi = ImageIO.read(new File((path)));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		repaint();
	}
/**
 * This method uses the standard java paintComponent method
 * and paints the backround image
 * @param g the graphics object g 
 */
	public void paintComponent(Graphics g) {
		g.drawImage(bi, 0, 0, null);
	}
}

